#ifndef __DIGITAL_TUBE_H__
#define __DIGITAL_TUBE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

/* 数码管相关定义 */
enum digital_tube_display_type_e {
    DIGITAL_TUBE_NUMBER = 0,
    DIGITAL_TUBE_MENU,
    DIGITAL_TUBE_RUNNING,
    DIGITAL_TUBE_SPEED,
    DIGITAL_TUBE_CLEAR,
};

struct digital_tube_ctrl {
    enum digital_tube_display_type_e type;
    uint16_t value;
    uint8_t menu_item;
};

void board_digital_tube_show_menu(uint8_t menu_index);

void digital_tube_display_timer_cb(void *param);
void digital_tube_set_type(enum digital_tube_display_type_e type);
void digital_tube_set_value(enum digital_tube_display_type_e type, uint16_t value);
uint16_t digital_tube_menu_get_index(void);
uint16_t digital_tube_menu_adjust_value(int8_t adjust);
uint16_t digital_tube_get_num_value(void);
void board_digital_tube_clear(void);

#ifdef __cplusplus
}   /* extern "C" */ 
#endif

#endif
